package br.com.locanet.service;

import java.util.List;

import javax.persistence.PersistenceException;

import br.com.locanet.bean.IEntity;
import br.com.locanet.dao.GenericJPADAO;
import br.com.locanet.exception.ExceptionList;

public interface EntityService<ENTITY extends IEntity>{
	public ENTITY insert(ENTITY entity) throws PersistenceException ;
	public void delete(ENTITY entity) throws PersistenceException ;
	public ENTITY update(ENTITY entity) throws PersistenceException ;
	public List<ENTITY> select(ENTITY entity) throws PersistenceException ;
	public List<ENTITY> selectAll() throws PersistenceException ;
	public ENTITY selectById(ENTITY entity) throws PersistenceException ;
	public GenericJPADAO<ENTITY> getDAO() throws ClassNotFoundException;
	public void doValidateRequiredFields(ENTITY entity) throws ExceptionList;
	public void doValidateBusinessRules(ENTITY entity) throws ExceptionList, PersistenceException, ClassNotFoundException;
}
